Conversation
- Add declare(strict_types=1) and return type declarations across all PHP files - Fix array_filter usage with explicit callbacks to prevent filtering falsy values like 0 - Fix my-open-orders endpoint to use query params instead of request body - Cache endpoint instances, server timestamp drift, and symbol map for performance - Make Message class immutable (throw on set/unset operations) - Fix BitkubResponseErrorCodeException to handle missing error codes gracefully - Replace @json_decode with proper validation - Improve stream name validation with regex in WebSocket MarketEndpoint - Change PendingRequest properties from public to private - Restrict code style CI to main branch, fix dependabot workflow trigger - Set minimum-stability to stable in composer.json - Fix README typos and incorrect API path for wallet endpoint - Add tests for GenerateSignatureV3, market order endpoints, and immutable Message - Add request recording to MockHttpClient for better test assertions
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #32 +/- ##
============================================
+ Coverage 82.36% 89.20% +6.84%
- Complexity 155 180 +25
============================================
Files 21 22 +1
Lines 482 556 +74
============================================
+ Hits 397 496 +99
+ Misses 85 60 -25 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
- Refactor WebSocketClient to accept engine and optional client via constructor - Add WebSocketClientBuilder for fluent WebSocket client configuration - Convert LiveOrderBookEndpoint symbol map from static to instance property - Add reconnection logic with configurable attempts to WebSocket Engine - Improve type hints and PHPDoc annotations across WebSocket components - Add MockWebSocketEngine and dedicated tests for Engine, endpoints, and builder
…ment - Fix WebSocket examples to use WebSocketClientBuilder instead of direct instantiation - Add documentation for LiveOrderBook endpoint - Add PHP 8.2+ requirement to README header - Add WebSocket section to table of contents
- Fix TypeError in Message::json($key) when called on invalid JSON body - Add tests for filterParams, GenerateSignatureV3, error codes, URI factory, PendingRequest send/interceptors, PSR-7 decorator delegation, lazy singletons, WebSocket client/builder edge cases, and market/orderbook endpoints
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Major quality and reliability overhaul for the Bitkub PHP SDK — enforces strict typing across all files, fixes several API and data-handling bugs, refactors the WebSocket client with a builder pattern, and significantly expands test coverage.
Breaking Changes
Messageclass is now immutable —offsetSet,offsetUnset,__set, and__unsetthrowBadMethodCallExceptionPendingRequestproperties changed frompublictoprivate— use accessor methods insteadWebSocketClientconstructor signature changed — accepts engine and optional HTTP client; useWebSocketClientBuilderfor configurationLiveOrderBookEndpointsymbol map is now an instance property instead of staticBug Fixes
array_filterusage with explicit callbacks to prevent filtering out valid falsy values (e.g.,0)my-open-ordersendpoint to sendsymas query param instead of request body (matches Bitkub API v3 spec)BitkubResponseErrorCodeExceptionto handle missing error codes gracefully instead of throwing raw exceptions@json_decodewith proper validation (is_arraychecks)GET→POST /api/v3/market/wallet)Improvements
declare(strict_types=1)and return type declarations across all PHP filesWebSocketClientBuilderfor fluent WebSocket client configurationCI/CD
mainbranch onlypull_request_target→pull_request)minimum-stabilitytostableincomposer.jsonDocumentation
WebSocketClientBuilderLiveOrderBookendpoint documentationTests
GenerateSignatureV3(header attachment, timestamp caching, HMAC computation)openOrders,myOrderHistory,myOrderInfo)Messagebehavior andResponseWithValidateErrorCodecustom callbacksMockHttpClientrequest recording for better test assertionsMockWebSocketEngineand tests for Engine, endpoints, and builderTest Plan
composer test— all existing and new tests passGenerateSignatureV3timestamp caching reduces server time API callsMessageimmutability throwsBadMethodCallExceptionon mutationarray_filterfix preserves valid falsy values (e.g.,0)my-open-orderssendssymas query param (not body)WebSocketClientBuilderproduces correctly configured clients